// #region 添加文章
$(".btn-add").on("click", function() {
  wbbjq.window.getContent();
  let wz = wbbjq.window.arr;
  alert(wbbjq.window.arr);
  // console.log(wz);
  // 1.获取表单中的所有的数据
  let slug = $(".form-add #slug").val();
  let provenance = $(".form-add #provenance").val();
  let author = $(".form-add #author").val();
  let category = $(".form-add #category option").val();
  // console.log(slug,provenance,author,category);
  $.ajax({
    type: "post",
    url: "/admin/postAddArticle",
    data: {
      slug: slug,
      provenance: provenance,
      author: author,
      category: category,
      wz: function() {
        return (arr = wbbjq.window.arr);
      }
    },
    success: function(data) {
      console.log(data);
      if (data.code == "1401") {
        alert(data.message);
        location.href = "/admin/post-add";
      }
    }
  });
});
// #endregion 添加文章
